Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peakwise fit function for calibration peak fits #72

Merged
merged 7 commits into from
Oct 6, 2024
Merged

Peakwise fit function for calibration peak fits #72

merged 7 commits into from
Oct 6, 2024

Conversation

LisaSchlueter
Copy link
Contributor

We want to have different peakshapes for the escape peaks and maybe for other low-statistics peaks. That's why I made the following changes:

  1. Peakwise fit function: Calibration peak fit function of th228 lines fit_peaks() now also accepts a vector of fit_func.
  2. Fit function stored in fit result
  3. I renamed the fit functions, to avoid confusion (too many f_fit , fit_func , ...). If you feel creative and have better suggestions, feel free to write them below.
    Available fit functions:
  • gamma_def: "default" gamma peakshape with gaussian signal, low-energy tail, and background (flat + step)
  • gamma_tails: default gamma peakshape + high-energy tail
  • gamma_bckSlope: default gamma peakshape + linear background slope
  • gamma_bckExp: default gamma peakshape + exponential background
  • gamma_bckFlat: default gamma peakshape - step background (only flat component!)
  • gamma_tails_bckFlat: default gamma peakshape + high-energy tail - step background (only flat component!)

Example: with escape peaks with high-energy tail but w/o Compton step

myfuncs = [fill(:gamma_def, 3)..., :gamma_tails_bckFlat, :gamma_def, :gamma_tails_bckFlat, :gamma_def]
result_fit, report_fit = fit_peaks(result_simple.peakhists, result_simple.peakstats, th228_names; 
                         e_unit=result_simple.unit, calib_type=:th228, fit_func = myfuncs)

@theHenks we could write the fit_func for the th228_names in jldataprod config, as we discussed. Any additional suggestions?
@fhagemann, @verenaaur I don't think that the A/E functions have to be adapted to this change, right?

@theHenks
Copy link
Collaborator

From my side this looks fine. I let @verenaaur check again then we can merge!
But before I will quickly add the bug fixes for the fitting!

@theHenks theHenks self-assigned this Sep 25, 2024
@theHenks theHenks added bug Something isn't working enhancement New feature or request labels Sep 25, 2024
This was linked to issues Sep 25, 2024
@verenaaur
Copy link
Contributor

I don't think it should have an impact on the A/E functions

@fhagemann
Copy link
Contributor

Do we care about the tests failing or should this be merged now?

@theHenks
Copy link
Collaborator

Problem with tests is still the open bug tackled in the other PR

@fhagemann
Copy link
Contributor

So all open PRs are to be postponed until #73 fixes the failing tests?

Copy link

codecov bot commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 40.74074% with 16 lines in your changes missing coverage. Please review.

Project coverage is 15.24%. Comparing base (64524fe) to head (732baee).
Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
src/pseudo_prior.jl 27.27% 8 Missing ⚠️
src/specfit_functions.jl 41.66% 7 Missing ⚠️
src/specfit.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #72      +/-   ##
==========================================
+ Coverage   15.01%   15.24%   +0.22%     
==========================================
  Files          33       33              
  Lines        2670     2676       +6     
==========================================
+ Hits          401      408       +7     
+ Misses       2269     2268       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@theHenks theHenks merged commit 692ea89 into dev Oct 6, 2024
10 checks passed
@theHenks theHenks deleted the ecal branch October 6, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A/E fit peakshapes Revise Energy calibration and peakshape
4 participants